package com.fyzk.betzhushu;

public class ZhuShuUtils {
	
	/**
	 * 求组合
	 * @param m   每一注小球个数
	 * @param n   真实小球个数(即点击小球的个数)
	 * @return
	 */
	public static long zuhe(int m, int n) {
		long t_a = 0L;
		long total = 1L;
		int temp = n;
		for (int i = 0; i < m; i++) {
			total = total * temp;
			temp--;
		}
		t_a = total / jiec(m);
		return t_a;
	}
	
	/**
	 * 求阶乘
	 * @param a
	 * @return
	 */
	public static long jiec(int a) {
		long t_a = 1L;
		for (long i = 1; i <= a; i++) {
			t_a = t_a * i;
		}
		return t_a;
	}

}
